﻿using MyMVC;
using STHPMS1.Common.C_Definition;
using STHPMS1.ICore;
using STHPMS1.ICore.I_Core;
using STHPMS1.ICore.I_Entity;
using STHPMS1.ICore.I_UI;
using STHPMS1.Web.W_Core;
using STHPMS1.Web.W_Model;
using System.Web;
using System.Web.UI;

namespace STHPMS1.Web.W_Core
{
    /// <summary>
    /// 默认页面基类
    /// </summary>
    public class MyPageBase : MyPage<NullPageModel>
    {
    }


    public class MyPage<T> : MyPageView<T>, IPage
        where T : IEntity
    {
		public MyPage ()
		{
		}


        private IScene _scene;
		public IScene Scene {
			get
            {
                if (_scene == null) 
                    _scene = MyApp.Locator.GetInstance<IUIFactory>().GetPageScene();
                return _scene;
            }
			set
            {
                _scene = value;
            }
		}

		public override void Dispose ()
		{
			if (Scene != null)
				Scene.Dispose ();
			Scene = null;
			base.Dispose ();
		}		
    }

}